Skip to content

feat(spark): port dataapi and auth evals to the original shape - #526

Draft
rjgtav wants to merge 6 commits into
mattrossman/ai-1551-run-spark-evals-with-starter-files-andfrom
rjgtav/spark-evals-math-originals
Draft

rjgtav wants to merge 6 commits into
mattrossman/ai-1551-run-spark-evals-with-starter-files-andfrom
rjgtav/spark-evals-math-originals

Conversation

@rjgtav

@rjgtav rjgtav commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor

What

Spark now supports RLS and works with supabase-js, so the Spark evals can follow the benchmark originals closely. This ports three of them: build-dataapi-001-relational-report-spark, build-dataapi-002-restock-alert-report-spark and build-auth-001-email-password-flow-spark. Each now ships the original app stub in local/, the original schema with RLS, and the original scorer checks. The scorer runs the agent's code through ctx.sandbox.

Framework change

One small addition on top of #553, which needs a look from whoever owns the harness:

  • ToolEvalContext gains an optional sandbox: the sandbox the agent worked in, when it ran in one. run-eval.ts passes cliSandbox?.sandbox to the scorer.

Why: the original evals run the agent's code in the agent's sandbox through ctx.exec (npm install, then node report.mjs with the project keys in the environment). #553 gives sandboxed tools-mode scorers hostWorkspace, runViteBuild and runVitest, but nothing that runs an arbitrary command in the agent's workspace, so the Spark scorers have no equivalent. Open to a narrower hook, such as ctx.runInWorkspace(cmd, { env }), if that is preferred.

Spark runtime and skills

  • getClient() now returns a publishable-key client, like the local stack. client keeps the secret key for ground-truth reads.
  • New shared helpers: stubSandbox (test stub) and checkNoRawSql.
  • The dataapi schemas are now the originals verbatim, including generated always as identity (Spark supports it now).
  • skills/spark is slimmed down: it says @supabase/supabase-js works against Spark and documents the migrations and /database/query endpoints for schema changes (the SDK can't run DDL), plus the auth summary and limits. The Spark experiment still installs it next to the default Supabase skills. Agents find the project through the SPARK_* environment variables.

Deviation from the original

auth-001: Spark can't run the handle_new_user trigger on auth.users, so the app has to create the profile row itself at signup, and the schema gains an insert policy for it. The prompt and the auth.mjs stub call the project "the Spark project" rather than "the Supabase project", so the wording doesn't hint at the SDK.

Pass rates

codex-gpt-6-luna, 5 runs each on the current branch. Spark runs use the default Supabase skills plus spark; the originals run on the local stack.

Eval Spark Original
build-auth-001-email-password-flow 2/5 5/5
build-dataapi-001-relational-report 0/5 0/5
build-dataapi-002-restock-alert-report 0/5 0/5
build-database-001-task-due-dates 5/5 no original
  • Every failure, on Spark and on the originals, is the SDK-usage gate (the agent didn't import @supabase/supabase-js). Four of the 10 Spark dataapi runs also tripped the raw-SQL check (the report queried /database/query).
  • dataapi-001 and dataapi-002 behave the same on Spark and on the originals: 0/5.
  • auth-001 differs: the original passes 5/5, while the Spark port fails the SDK gate in 3 of 5 runs. In the Spark runs where the agent used the SDK it had usually read the supabase skill as well, and the original prompt calls the project "the Supabase project", which seems to steer it there.
  • database-001 passes with the spark skill; without it the agent couldn't find the project or run DDL.

@rjgtav rjgtav self-assigned this Nov 18, 2026
@vercel

vercel Bot commented Nov 18, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated
evals Ignored Ignored Preview Nov 26, 2026 6:43pm UTC

Request Review

@rjgtav
rjgtav force-pushed the rjgtav/spark-evals-math-originals branch 2 times, most recently from 13d306d to 11a91da Compare November 18, 2026 19:29
@rjgtav
rjgtav marked this pull request as ready for review November 19, 2026 12:54
@rjgtav
rjgtav requested review from a team as code owners November 19, 2026 12:54
@rjgtav
rjgtav force-pushed the rjgtav/spark-evals-math-originals branch from 11a91da to 8e97815 Compare November 20, 2026 17:53
@mattrossman

Copy link
Copy Markdown
Collaborator

Hey @rjgtav , I think I'd like to split this into two parts. The eval/runtime changes which you own, and the broader framework change.

For the framework change I'm filing AI-1551 to decide what that change will involve, so we have space there to discuss the right way to model things so we can support all the possible seed / stack configurations.

For example, we might also want to support scenarios that use the MCP interface but also seed local app files, which isn't supported yet here.

rjgtav commented Nov 23, 2026

Copy link
Copy Markdown
Contributor Author

@mattrossman Sounds good! Agree that it should be properly supported instead of a quick fix. I'll switch the PR back to draft then

@rjgtav
rjgtav marked this pull request as draft November 23, 2026 19:02
@mattrossman

Copy link
Copy Markdown
Collaborator

@rjgtav I put together a proposal for a broader framework change to offer more flexibility for local stack environment configurations (which also allows for Spark projects to have a local/ seed), let me know if you have any concerns but I'll plan on implementing it.

@mattrossman

Copy link
Copy Markdown
Collaborator

Started the framework side in #553 FYI @rjgtav

Lets a scorer run the files the agent produced in the sandbox it worked in.
getClient now returns a publishable-key client, like the local stack, while
client keeps the secret key for reading ground truth. Add stubSandbox for the
Spark eval tests and checkNoRawSql, which also rejects the SQL endpoint.
@rjgtav
rjgtav force-pushed the rjgtav/spark-evals-math-originals branch from 8e97815 to 87c0417 Compare November 26, 2026 11:43
@rjgtav
rjgtav changed the base branch from main to mattrossman/ai-1551-run-spark-evals-with-starter-files-and November 26, 2026 11:53
Same app stub, schema with RLS and scorer checks as the benchmark eval, run
through supabase-js against a Spark project.
Spark has no triggers on auth.users, so the app creates the profile row
itself after signup; the schema gains an insert policy for that.
@rjgtav
rjgtav force-pushed the rjgtav/spark-evals-math-originals branch 2 times, most recently from d6b379b to 508cdc4 Compare November 26, 2026 17:23
@rjgtav
rjgtav force-pushed the rjgtav/spark-evals-math-originals branch from 508cdc4 to 400c010 Compare November 26, 2026 18:43

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants